From 0f66bdecfe3418e2b1f8100d53d3ebce00d96462 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Mon, 25 Sep 2017 20:56:55 +0200 Subject: [PATCH] babl: add decrease of bits per components to bad_idea() related to bug #787441 --- babl/babl-fish-path.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index b7133af..6b2874b 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -165,6 +165,13 @@ bad_idea (const Babl *from, const Babl *to, const Babl *format) { return 1; } + if (from->format.type[0]->bits > format->format.type[0]->bits) + { + /* XXX: perhaps we especially avoid going to half-float, when + * going between u16 formats as well? */ + return 1; + } + return 0; } -- 2.30.2